package com.hu.mapper;

import com.hu.entity.pojo.QuestionEntity;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface QuestionMapper {
    /**
     * 修改题目状态
     * @param type
     */
    @Update("update question set ${type} = #{operation} where id = #{id}")
    void updateStatus(Integer id,String type,Integer operation);

    /**
     * 根据类型查找题目
     * @param status
     * @return
     */
    List<QuestionEntity> getQuestions(Long userId, String type);

    /**
     * 根据id删除题目
     * @param id
     */
    @Delete("delete from question where id = #{id}")
    void deleteQuestionById(Integer id);
}
